/**
 * Created by lihao on 2017/3/20.
 */
var Html = require('../../../component/common/header-bar.html');
var UserService = require('../../module/UserService');
require('../../../css/component/common/header.less');
avalon.component('ms-header', {
    template: Html,
    defaults: {
        userData: {},
        status: false,
        logout: function () {
            this.status = false;
            UserService.logout();
            return null;
        },
        onInit: function () {
            var _this = this;
            //用户信息
            UserService.getUser()
                .then(function (user) {
                    _this.userData = user;
                    _this.status = true;
                    return null
                })
                .catch(function (err) {
                });
        },
        onReady: function (e) {
        },
    }
});
